<template>
  <van-overlay :show="show" @click="show = false">
    <div class="loading-wrapper" @click.stop>
      <van-loading color="#0094ff" />
    </div>
  </van-overlay>
</template>
<script>
import Vue from "vue";
import { Loading } from "vant";
import { Overlay } from "vant";
Vue.use(Overlay);
Vue.use(Loading);
export default {
  props: {
    loading: {
      type: Boolean,
      default: true,
    },
  },
  watch: {
    loading(val) {
      this.show = val;
    },
  },
  data() {
    return {
      show: true,
    };
  },
};
</script>
<style lang="less">
.loading-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
</style>